package cn.jinjie.day05.test2;

public class Demo1 {
    public static void main(String[] args) {

        //请用子类的形式调用fun
        Cat c = new Cat();
        fun(c);
        //请用匿名内部类的形式调用fun
        fun(new Animal() {
            @Override
            public void show() {
                System.out.println("猫");
            }
        });


    }

    public static void fun(Animal a) {
        a.show();
    }
}


